﻿using System.Web;
using System.Web.Optimization;

namespace ESPL.CodeGenerator.Web
{
    public class BundleConfig
    {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                      "~/Scripts/bootstrap.js",
                      "~/Scripts/respond.js"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css"));

            RegisterAppJSBundles(bundles);
            RegisterAppCSSBundles(bundles);
            // Set EnableOptimizations to false for debugging. For more information,
            // visit http://go.microsoft.com/fwlink/?LinkId=301862
            BundleTable.EnableOptimizations = false;
        }

        public static void RegisterAppCSSBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/AppMain").Include(
                      "~/css/AdminLTE.css",
                      "~/Content/toastr.css"));
        }

        public static void RegisterAppJSBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/AngularjsCore").Include(
                        "~/Scripts/angular.js",
                        "~/Scripts/angular-sanitize.js",
                        "~/Scripts/angular-ui-router.js",
                        "~/Scripts/angular-animate.min.js",
                        "~/Scripts/angular-route.js",
                        "~/Scripts/plugins/ocLazyLoad.min.js",
                        "~/Scripts/angular-ui/ui-bootstrap-tpls.js",
                        "~/Scripts/plugins/angular-local-storage.js"
                        ));

            bundles.Add(new ScriptBundle("~/AppBootstrap").Include(
                        "~/app/easyCodeApp.js",
                        "~/app/easyCodeDirectives.js",
                        "~/app/core/authService.js",
                        "~/app/core/authInterceptorService.js"
                        ));

            bundles.Add(new ScriptBundle("~/Blocks").Include(
                        "~/app/blocks/logger/logger.module.js",
                        "~/app/blocks/logger/logger.js",
                        "~/app/blocks/exception/exception.module.js",
                        "~/app/blocks/exception/exception-handler.js",
                        "~/app/blocks/exception/exception.js"
                        ));

            bundles.Add(new ScriptBundle("~/Core").Include(
                        "~/app/core/core.module.js",
                        "~/app/core/constants.js",
                        "~/app/core/common.js",
                        "~/app/core/config.js"
                        //"~/app/layout/menuCtrl.js"
                        ));
        }
    }
}
